{extend name="base" /} {block name="body"}
<div class="layui-body">
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li class="layui-this">访问统计</li>
		</ul>
		<div class="layui-tab-content">
			<form class="layui-form layui-form-pane" action="{:url('member/visit_list')}" method="get">
				<div class="layui-inline">
					<label class="layui-form-label">关键词</label>
					<div class="layui-input-inline">
						<input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<select name="ziduan">
						<option value="id" {if $ziduan=='id' }selected{/if}>访问者ID</option>
						<option value="nick_name" {if $ziduan=='nick_name' }selected{/if}>访问者昵称</option>
					</select>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label" style="width: 150px">访问时间</label>
		            <div class="layui-inline">
					    <div class="layui-input-inline">
				        <input type="text" class="layui-input" {if $begin_time} value="{$begin_time}" {/if} name="begin_time" id="begin_time" placeholder="yyyy年MM月dd日">
					    </div>
					</div>
		                <i class="chax_line"></i>
		            <div class="layui-inline">
					    <div class="layui-input-inline">
					    <input type="text" class="layui-input" {if $end_time} value="{$end_time}" {/if} name="end_time"  id="end_time" placeholder="yyyy年MM月dd日">
					    </div>
					</div>
				</div>
				<div class="layui-inline">
					<button class="layui-btn">搜索</button>
				</div>
			</form>
			<hr>
			访问用户：{$count?$count : 0}&nbsp;&nbsp;今日访问:{$tc}&nbsp; &nbsp; 本月访问:{$mc}
			<table class="layui-table">
				<thead>
					<tr>
						<th>ID</th>
						<th>昵称</th>
						<th>头像</th>
						<th>访问时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					{foreach name="visit_list" item="vo"}
					<tr>
						<td>{$vo.id}</td>
						<td>{$vo.nick_name}</td>
						<td><img style="width: 40px;height: 40px;" src="{$vo.logo}"</td>
						<td>{$vo.add_time}</td>
						<td>
							<a ref="delete_visit?id={$vo.id}" class="layui-btn layui-btn-danger layui-btn-small confirm">删除</a>
						</td>
					</tr>
					{/foreach}
				</tbody>
			</table>
			<!--分页-->
			{$visit_list->render()}
		</div>
	</div>
</div>
<script>
	// 定义全局JS变量
	var GV = {
		current_controller: "{$controller}/visit_list"
	};
</script>
{/block}
{block name="js"}
<script src="/public/static/layui/layui.js"></script>
<script>
	layui.use('laydate', function(){
		var laydate = layui.laydate;
		
		//日期控件
		laydate.render({
		    elem: '#begin_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
		  
		laydate.render({
		    elem: '#end_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
		
	})
</script>{/block}